import React, { Component } from 'react';
import HeaderCommon from './components/common/HeaderCommon';
import { connect } from 'react-redux';
import * as DataName from "./action/DataNameConfig";
import Util from "./utils/Util"
import {Layout} from 'antd';
import './style/css/index.less';
var Content = Layout.Content;
var Footer = Layout.Footer;

class App extends Component {
    componentDidMount(){
        /* 执行获取任务列表 */
        let { User } = this.props;
        Util.resetWindowTitle(User);
    }
    render() {
        return (
            <Layout className="ant-layout-page">
                <HeaderCommon />
                <Content style={{ margin: '0 16px', overflow: 'initial' }}>
                  {this.props.children}
                </Content>
                <Footer style={{ textAlign: 'center' }}>
                    {DataName.SYSTEM_CONFIG_TITLE} ©2018 Created by 科学家在线
                </Footer>
            </Layout>
        );
    }
}

export default connect(state=>({
    User: state.User,
    httpData:state.httpData,
    SystemConfig:state.SystemConfig
}))(App);
